<?php if(isset($r['list'])){?>
<form action="<?php e_page("shop","index")?>" method="get">
    <fieldset>
        <legend></legend>
        <label for="company">商家名称</label><br/>
        <input type="text" name="company" id="company" placeholder="请输入商家名称"/><br/>
        <label for="real_name">负 责 人</label><br/>
        <input type="text" name="real_name" id="real_name" placeholder="请输入负责人姓名"/><br/>
        <label for="tel">负责人电话</label><br/>
        <input type="text" name="tel" id="tel" placeholder="请输入负责人电话"/>
        <input type="submit" value="搜索"/>
    </fieldset><br/>
</form>
<table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>商家名称</th>
        <th>公司地址</th>
        <th>负责人</th>
        <th>联系方式</th>
        <th>邮箱</th>
        <th>审核通过/冻结</th>
        <th>查看详情</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($r['list'] as $v){?>
        <tr>
            <td><?php echo $v['id'];?></td>
            <td><?php echo $v['company'];?></td>
            <td><?php echo $v['address'];?></td>
            <td><?php echo $v['real_name'];?></td>
            <td><?php echo $v['tel'];?></td>
            <td><?php echo $v['email'];?></td>
            <td><?php if($v['enable']==1){?>  <?php echo "已通过/";}else{?>  <a href="<?php e_action("checkPass","id={$v['id']}")?>">通过</a> <?php }?>   <?php if($v['enable']==1){?>    <a href="<?php e_action("checkCancel","id={$v['id']}")?>">冻结</a><?php }?></td>
            <td><a href="<?php e_action("detail","id={$v['id']}")?>">查看详情</a></td>
            <td><a href="<?php e_action("shopModify","id={$v['id']}")?>">修改</a> / <a href="<?php e_action("shopDelete","id={$v['id']}")?>" onclick="return confirm('确定删除吗？');">删除</a></td>
        </tr>
    <?php } ?>
    </tbody>
</table>
<?php
/** @var Page $page */
$page=$r['pages'];
?>
<?php echo $page->getPageHtml(); ?>
<?php }else if(isset($r['search'])){?>
    <table id="dataTable">
        <thead>
        <tr>
            <th>ID</th>
            <th>商家名称</th>
            <th>公司地址</th>
            <th>负责人</th>
            <th>联系方式</th>
            <th>邮箱</th>
            <th>审核通过/冻结</th>
            <th>查看详情</th>
            <th>操作</th>
        </tr>
        </thead>
        <?php foreach($r['search'] as $v){?>
        <tbody>
            <tr>
                <td><?php echo $v['id'];?></td>
                <td><?php echo $v['company'];?></td>
                <td><?php echo $v['address'];?></td>
                <td><?php echo $v['real_name'];?></td>
                <td><?php echo $v['tel'];?></td>
                <td><?php echo $v['email'];?></td>
                <td><?php if($v['enable']==1){?>  <?php echo "已通过/";}else{?>  <a href="<?php e_action("checkPass","id={$v['id']}")?>">通过</a> <?php }?>   <?php if($v['enable']==1){?>    <a href="<?php e_action("checkCancel","id={$v['id']}")?>">冻结</a><?php }?></td>
                <td><a href="<?php e_action("detail","id={$v['id']}")?>">查看详情</a></td>
                <td><a href="<?php e_action("shopModify","id={$v['id']}")?>">修改</a> / <a href="<?php e_action("shopDelete","id={$v['id']}")?>" onclick="return confirm('确定删除吗？');">删除</a></td>
            </tr>
        </tbody>
        <?php }?>
    </table>
<?php }else{ echo "暂无此商家信息"?>
<?php }?>